package com.lansea.wms.model;

import com.lansea.wms.model.base.BaseBetweenTime;
import com.lansea.wms.util.DateUtil;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;

import java.util.Date;
@Data
@Repository
@ApiModel(value = "LoginRecord", description = "登录日志")
public class LoginRecord extends BaseBetweenTime {

    private Integer id;
    private Integer uid;
    private Integer type;

    @DateTimeFormat(pattern = DateUtil.DATE_TIME_FORMAT)
    private Date createTime;
    private String ip;

    private String userName;
    private String realName;


    public String getTypeText() {
        return type == 1 ? "用户登录" : "退出登录";
    }


}
